package zuoye05;

import java.util.ArrayList;

public class zuoye07 {
    public static void main(String[] args) {
        String long_a = "ppRYYGrrYBR2258";
        String short_a = "YrR8RrY";
        String long_b = "ppRYYGrrYB225";
        panduan(short_a, long_a);
        panduan(short_a, long_b);
    }

    public static void panduan(String short_a, String long_a) {
        boolean b = true;
        for (char cc : short_a.toCharArray()) {
            int a = 0;
            int d = 0;
            for (char cccc : short_a.toCharArray()) {
                if (cc == cccc) {
                    a = a + 1;
                }
            }
            for (char ccc : long_a.toCharArray()) {
                if (long_a.indexOf(ccc) == -1) {
                    b = false;
                    break;
                }
                if (cc == ccc) {
                    d = d + 1;
                }
            }
            if (d < a) {
                b = false;
            }
        }
        int e=long_a.length()-short_a.length();
        if (b) {
            System.out.println("YES "+e);
        } else {
            System.out.println("NO");
        }

    }
}